namespace MVCBootStrapShell_WithTheme.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddModel_Movie : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.PageContents", "Page_PageId", "dbo.Pages");
            DropIndex("dbo.PageContents", new[] { "Page_PageId" });
            CreateTable(
                "dbo.Movies",
                c => new
                    {
                        MovieId = c.Int(nullable: false, identity: true),
                        Title = c.String(),
                        Rating = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.MovieId);
            
            DropTable("dbo.Pages");
            DropTable("dbo.PageContents");
        }
        
        public override void Down()
        {
            CreateTable(
                "dbo.PageContents",
                c => new
                    {
                        PageContentId = c.Int(nullable: false, identity: true),
                        Text = c.String(),
                        PicturePath = c.String(),
                        PictureSize = c.Int(nullable: false),
                        PicturePosition = c.Int(nullable: false),
                        Page_PageId = c.Int(),
                    })
                .PrimaryKey(t => t.PageContentId);
            
            CreateTable(
                "dbo.Pages",
                c => new
                    {
                        PageId = c.Int(nullable: false, identity: true),
                        PageType = c.Int(nullable: false),
                        Title = c.String(nullable: false),
                        SubTitle = c.String(nullable: false),
                        Keywords = c.String(nullable: false),
                    })
                .PrimaryKey(t => t.PageId);
            
            DropTable("dbo.Movies");
            CreateIndex("dbo.PageContents", "Page_PageId");
            AddForeignKey("dbo.PageContents", "Page_PageId", "dbo.Pages", "PageId");
        }
    }
}
